import { lazyReportBatch } from "../report";
export default function observerLoad() {
  window.addEventListener("pageshow", function (event) {
    requestAnimationFrame(() => {
      ["load"].forEach(function (type) {
        const reportData = {
          type: "performance",
          subType: type,
          pageUrl: window.location.href,
          startTime: performance.now() - event.timeStamp,
        };
        console.log(reportData);
        lazyReportBatch(reportData);
      });
    });
  });
}
